/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1, header h2 {
    margin-bottom: 10px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: bold;
}

header h2 {
    font-size: 1.8rem;
    font-weight: normal;
}

header p {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

/* Main Content */
.card-creator {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.controls {
    flex: 1;
    min-width: 300px;
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.preview-area {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.preview-area h3 {
    text-align: center;
    color: white;
    margin-bottom: 15px;
}

/* Template Selector */
.template-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.template-btn {
    background: none;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 100px;
}

.template-btn:hover {
    border-color: #667eea;
    transform: translateY(-3px);
}

.template-btn.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.template-preview {
    width: 100%;
    height: 80px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.classic-preview {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.modern-preview {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.elegant-preview {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.template-btn span {
    display: block;
    text-align: center;
    font-size: 0.9rem;
}

/* Customization Options */
.customization-options {
    margin: 25px 0;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Action Buttons */
.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Card Preview */
.card-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.thank-you-card {
    width: 100%;
    max-width: 400px;
    min-height: 500px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.thank-you-card:hover {
    transform: translateY(-10px) rotateY(5deg);
}

/* Special styling for export */
.thank-you-card.exporting {
    transform: none !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Card Templates */
.thank-you-card.classic {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.thank-you-card.modern {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: #333;
}

.thank-you-card.elegant {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #333;
}

/* Card Elements */
.card-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.decoration-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.card-title {
    font-size: 2rem;
    margin: 10px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-title.english {
    font-size: 1.5rem;
    font-weight: normal;
}

.card-content {
    text-align: center;
}

.recipient, .sender {
    margin-bottom: 20px;
}

.recipient p, .sender p {
    margin: 5px 0;
}

.teacher-name, .student-name {
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 10px;
}

.message-container {
    margin: 25px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.message {
    font-size: 1rem;
    line-height: 1.6;
    margin: 10px 0;
}

.message.english {
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 15px;
}

.card-footer {
    text-align: right;
    margin-top: 30px;
}

.date {
    font-style: italic;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-creator {
        flex-direction: column;
    }
    
    .controls, .preview-area {
        width: 100%;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header h2 {
        font-size: 1.5rem;
    }
    
    .thank-you-card {
        max-width: 100%;
    }
}